﻿using System;
using UnityEngine;

public class TestHudCamera : MonoBehaviour
{
    private Camera mainCamera;
    private Camera hudCamera;
    
    // Start is called before the first frame update
    void Start()
    {
        mainCamera = transform.parent.GetComponent<Camera>();
        hudCamera = GetComponent<Camera>();
    }

    // Update is called once per frame
    void Update()
    {
        
        if (Math.Abs(hudCamera.fieldOfView - mainCamera.fieldOfView) > 0.005f)
        {
            hudCamera.fieldOfView = mainCamera.fieldOfView;
        }
    }
}
